<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS流程控制</title>
</head>
<body>
<script>
    //1.顺序结构
    console.log(1);
    console.log(2);
    console.log(3);
    console.log(4);
    //2.分支结构
    if ('3'<'10'){
        console.log('比较的是数值3<10')
    }else {
        console.log('比较的是编码')
    }
    //3.选择分支
    let gender=1;
    switch (gender){
        case 1:
            console.log('先生');
            break;
        case 0:
            console.log('女生');
            break;
        default:
            console.log('保密')
    }
    //4.循环结构
    let names=['张三','李四','王五','赵六','钱七'];
    for (var i=0;i<names.length;i++){
        console.log(names[i]);
    }
    // 如果是用
    // console.log(i)
    //增强for循环
    for ( let n of names){
        console.log(n);
    }
</script>

</body>
</html>